Search Results: "ncm"

23 December 2011

Keith Packard: calypso

Calypso CalDAV/CardDAV/WebDAV for Android and Evolution Ever since I bought my first Palm Pilot in 1997, I ve relied upon a pocket-able device to carry a copy of my calendar and contacts, and for that same database to be present on my laptop. I went through a long list of Palm-compatible devices, including both the Palm Treo and Palm Centro telephones. I even wrote a number of my own Palm applications. Years ago, it was pretty obvious that I d have to find a new phone, but I was stuck looking for something that could provide the same hot-sync functionality. SyncML on the Series 40 I bought a Series 40 Nokia phone in Shanghai that promised SyncML support. Given that I had seen numerous SyncML implementations for Linux, it seemed like I should be able to get something to work. SyncML on the Series 40 is a disaster the phone couldn t actually store all of my contacts, and it couldn t hold half of the data fields I used. So, that phone landed in the box and back to the Centro I went. SyncML on the N900 Nokia kindly sent me an N900 at some point, so I gave SyncML another try. Given that the N900 runs evolution-data-server, and that I ve had evolution-data-server running on my laptop, it seemed like I should be in business. Well, almost. It took several days of hacking to fix bugs in the evolution SyncML back end, then another several days fussing with opensync. I ended up abandoning direct synchronization as unworkable opensync would sit in an infinite loop, or worse, trash my database completely. I finally found syncml-ds-tool , which is a debugging tool that comes with opensync. This tool simply synchronizes a set of disk files, one per contact or calendar entry, with the phone. That worked for well over a year. And then, a few months ago, Bluetooth on the laptop stopped connecting with the phone s SyncML server. I d get ECONNREFUSED every time I tried to use it. So much for the N900. DUN still worked, mostly, although it too would get ECONNREFUSED at times, but retrying seemed to make it work. However, While the N900 SyncML solution worked, I discovered another thing I wanted contacts and calendar entries stored in individual files and revision controlled with git. This makes it reasonable to delete stale calendar entries and know that they re never really gone, just left behind in an older version of the calendar. And, if you mess up, you can recover by poking at the database with git directly. I switched back to the venerable Palm Centro; it turns out that calendar and contacts are more important to me than being able to surf the web on my phone. Alas, my Centro went swimming in August and has passed on to the great electronics recycling house in the sky. I pulled the SIM out and switched back to the N900. I got my contacts imported on the N900 by copying files over the net work; not a long-term strategy, but at least I had phone numbers again. There was no hope for my calendar. I started looking for a solution in earnest. How about Android? At this point in my story, I m sure you re asking why I didn t just use one of the numerous Android phones that came through my hands. The answer is simple my calendar and contacts are probably some of my most personal data, and I m not willing to store them outside of my direct control, for reasons similar to those which are driving the development of the FreedomBox. When Android first came out, it could only talk to Google services, which didn t meet my hard requirement for personal data storage. One of my co-workers had his Google account suspended for violating the terms-of-service; he asked what he had done, but they wouldn t say. He asked if he could get his data back, and they said no . They invited him to create a new account, but it would not ever get any of the old data. A few days later, he got a nice apologetic email letting him know that they d made a mistake and that he hadn t, in fact, violated any of the terms-of-service, and that his old account was restored with all of his data intact. Wasn t that nice of Google? WebOS? I got a WebOS phone over the summer and discovered that while it had multiple contact/calendar back ends, none of them used standard protocols and so you only had the choice between multiple corporate data centers, which isn t actually a choice at all. Furthermore, the WebOS phone refused route PAN packets over the phone network, even though I have a data plan which allows this. It s not that it couldn t support it, it s that it refused. A couple of weeks after the WebOS phone arrived, HP canceled all of their WebOS hardware products, which made me less interested in trying to solve this problem. Android recovers About the same time the WebOS phone arrived, I discovered that Google had published enough information about the calendar/contacts internals for Marten Gajda to write CalDAV-Sync and CardDAV-Sync. And then, Andrew McMillan wrote aCal, which is a complete replacement for the built-in calendar and contacts applications and supports CalDAV and CardDAV. With two different standards-compliant solutions available, it seemed like it might be time to try Android again. I d love for CardDAV-Sync and CalDAV-Sync to become free software like aCal is. Andrew makes money from aCal by offering it for sale via the Android Market, while still publishing the sources for those who want to build their own copy. CalDAV/CardDAV on Linux I think the most widely known CalDAV server for Linux is probably DAViCal, a huge pile of PHP and SQL sitting on top of Apache. I m sure it s suitable for running on a server and being accessed over the internet, but I m not interested in that, nor am I interested in having my laptop run Apache and PostgreSQL. I found a tiny little CalDAV server, Radicale, which seemed like a lot better fit. It s written in Python and uses the usual Python HTTP server infrastructure, which provides SSL and authentication support along with some fairly convenient APIs for parsing and generating HTML. Before long, I discovered that Radicale was actually too simple for my needs. It stores the whole calendar in a single file, re-parsing it whenever a request is made, so a calendar with just hundreds of entries caused the server to slow down enough that evolution would time-out when talking to it. Also, Radicale doesn t actually parse the calendar entries completely, it has some ad-hoc code that finds various pieces of data, but without dealing with the whole syntax. I started hacking at Radicale to see how far I could get. I changed the storage code to store one event per file, then added hooks to use git for change management. Then, I found a full vcalendar/vcard parsing library in python, vobject, which I used to replace the ad-hoc parsing code. Finally, I added support for VCARD entries as well, allowing the system to store both calendar and contact information. Introducing Calypso, a CardDAV/CalDAV server With this much divergence from the original project, I ve figured I d best rename things to avoid confusion, so I decided to call it calypso , after a brief trip through the dictionary looking for names starting with ca . Calypso works with evolution, iceowl and the Android CalDAV/CardDAV plugins. It does not yet work with aCal; for some reason aCal cannot find any calendars on the server. Calypso also supports importing calendar changes from the command line, allowing you to integrate support into a text-based email application like notmuch or mutt. Calypso is available via git from git://keithp.com/git/calypso and is distributed under the GPL (v3 or later). I still consider it a work derived from Radicale, and so the code retains all of the Radicale copyrights along with my own. Using Calypso Initial setup Calypso runs as a regular user, all data are stored in ~/.config/calypso. To initialize calypso:
$ mkdir ~/.config/calypso ~/.config/calypso/calendars
$ cat > ~/.config/calypso/config << EOF
[server]
ssl=true
certificate=/home/keithp/.config/calypso/ssl/server.crt
key=/home/keithp/.config/calypso/ssl/server.key
[acl]
;type=htpasswd
type=fake
filename=/home/keithp/.config/calypso/passwd
Running calypso Then run calypso:
$ python ./calypso.py
No, I haven t figured out how to install it Creating new calendars To add a new database:
$ mkdir -p ~/.config/calypso/calendars/private/my_calendar
$ cd ~/.config/calypso/calendars/private/my_calendar
$ git init
$ git commit --allow-empty -m'initialize new calendar'
The new calendar should now be visible as https://localhost:5233/private/my_calendar You can add files to the directory at any time; calypso will check the directory mtime at each operation and update its internal state from that on disk automatically when the directory changes. Importing files Given a set of files with VCALENDAR or VCARD entries, you can import them with:
$ calypso --import private/my_calendar <filenames...>
This will update any changed entries and add any new ones. ToDo list for calypso
  1. Document the config file contents.
  2. Make it installable
  3. Figure out what aCal wants
  4. Support calendar creation
More Android info I m running cyanogenmod on my Nexus S as that provides PAN support. With PAN, I can create a network link between laptop and phone which doesn t depend on any local WiFi infrastructure and which gives both phone and laptop static IP addresses, allowing me to configure the sync URLs statically on the phone. I d use mDNS, but Android doesn t bother to support that.

2 July 2011

Guillaume Mazoyer: Status report Jigsaw num. 3 for GSoC 2011

code.pngAt beginning of the last two weeks, I was working on the final package of JTReg. I was working on generating man pages and I finally found a solution. I decided to use help2man to generate the man pages but I had to patch the two scripts jtreg.sh and jtdiff.sh . Basically, these two scripts launch main classes of the jtreg.jar JAR file. The problem with them is that they don t know where they can find the JAR file on Debian. So I patched the two scripts shell so they can locate JAR files in /usr/share/java .
To be able to generate man pages with help2man, I needed to be able to use the scripts. But with jtdiff.sh and jtreg.sh using jtreg.jar which is not in /usr/share/java during the build, I had to find a way to make the scripts work. I decided to patch the scripts (again) and make them depend of some environment variables. So in each script, there are 4 used variables: So during the packaging only JTREG_HOME needed to be changed to be able to use the script. Once the scripts patch done, I finally wrote the rules file of the package. Once again, I used javahelper so the rules file contains the following code:

#!/usr/bin/make -f
JAVA_HOME = /usr/lib/jvm/default-java

override_dh_auto_build:
ant -f make/build.xml
dh_auto_build
JTREG_HOME=./dist/jtreg/lib/ help2man \
--name="Regression Test Harness" \
--help-option="-help" \
./dist/jtreg/linux/bin/jtdiff > jtdiff.1
JTREG_HOME=./dist/jtreg/lib/ help2man \
--name="Regression Test Harness" \
--help-option="-help" \
./dist/jtreg/linux/bin/jtreg > jtreg.1

override_dh_auto_clean:
rm -r dist :
rm -r build :
rm jtdiff.1 :
rm jtreg.1 :
dh_auto_clean

%:
dh $@ --with javahelper


As you can see it is not really complicated. The most interesting part is the one when the man pages are generated. The JTREG_HOME variable is set to ./dist/jtreg/lib/ because it is the path where jtreg.jar is once it is built. I also used the help-option option of help2man because the help option of jtreg and jtdiff is -help and not help .
The jtreg package is now on the Debian Java team SVN so anyone can get it using:

svn checkout svn+ssh://$ SVN_USER @svn.debian.org/svn/pkg-java/trunk/jtreg

Thanks to Sylestre Ledru, jtreg is now available in Sid and the ITP is now closed.

The second part of my work consisted in testing Jigsaw and fixed tests if necessary. All the packaging work is now useful since the tests need JTReg to be run. The problem with the current build system of Jigsaw is that it is enough generic to be used on any system. So I had to patch several makefiles. To find them:

cd jigsaw-tests
find . -name 'Makefile' grep '/test/Makefile'

Then, the path to find jtreg has to be modified to match /usr/bin/jtreg . After that it is possible to run the tests with the following command:

make test

Passing all the tests is something which takes a lot of time. After that, I identified 42 (that s a cool number right?) failing tests. Some of them came from the lack of X11 server and other from unreachable network hosts. Some hackers of IcedTea gave me some ideas to fix several tests. They told me to look here and here because I just had the same problems that they had before.
With this, I was able to fix the tests related to unreachable hosts and to the lack of X server. I used Xvfb to fix the X server depending tests.
After running the tests again, only 13 tests were still failing. That is a good result. Tom Marble and me decided to apply the patch of Alan Bateman and re-run the tests to see if it will break something:

cd jigsaw-tests
mkdir patches && cd patches
wget http://cr.openjdk.java.net/~alanb/jigsaw-mp-prototype1/webrev/jdk.patch
cd jdk
patch -p1 < ../patches/jdk.patch
make clean
make sanity
make all
make modules
xvfb-run -e xvfb-errors -a -s -ac make test -k


15 tests failed against 13 before. The 2 new failing tests are: I didn t go further but I ll try to understand why we have 15 failing tests in few days. All the modifications that I have made on the source code of Jigsaw can be found in a patch format here:

This 2 weeks were also dedicated to the understanding of Jigsaw and its modules. Reading the jigsaw-dev mailing list, I have found some interesting conversation about jigsaw and how to write modules. So I decided to write a module to see how it works. I followed the instruction of the quick start guide but when compiling the module didn t work. So I tried to understand why and then to fix it. I eventually compiled and installed my module and here is how I did it:

mkdir -p src/com.greetings/com/greetings/
mkdir -p src/org.astro/org/astro/
mkdir modules
vim src/com.greetings/module-info.java
vim src/com.greetings/com/greetings/Hello.java
vim src/org.astro/module-info.java
vim src/org.astro/org/astro/World.java
./jigsaw/build/linux-amd64/bin/javac -d modules \
-modulepath ./jigsaw/build/linux-amd64/modules/modules \
-sourcepath src find src -name '*.java'
./jigsaw/build/linux-amd64/bin/jmod create -L mlib
./jigsaw/build/linux-amd64/bin/jmod install \
modules org.astro com.greetings -L mlib
./jigsaw/build/linux-amd64/bin/java -L mlib -m com.greetings


And here it is, we have a nice hello world module. The documentation says to put the module-info.java of org.astro in src/org.astro/org/astro/ but it didn t work for me so I tried to put it in src/org.astro/ and it worked. Also the quick start guide says that we have to use the -modulepath option to specify where the modules are. I first tried to use ./jigsaw/build/linux-amd64/modules/ but javac told me he could not find java.lang so I noticed that there is a subdirectory called modules in ./jigsaw/build/linux-amd64/modules/ so I used it as module path and it worked.

Writing a module and seeing how Jigsaw modules are made started to make me think about the packaging of Jigsaw. Dependencies being available, knowing how to build and test Jigsaw and seeing how modules are made, I think that I will soon try to start the packaging of Jigsaw and getting started with the packaging will be my goal for the next two weeks.

15 May 2011

Lars Wirzenius: vmdebootstrap and FreedomBoxLite

I played around some with with vmdebootstrap, my little toy to generate a disk image with a pre-installed Debian system. I added some more features, and to show them off, created a simplistic, proof-of-concept image to demostrate what FreedomBox might do. The image includes Apache and an SSH server, and a pre-configured user. You can use SFTP to put files on the server, and HTTP to access them. An instant file-sharing appliance. A real FreedomBox should, of course, do all sorts of other things, and this filesharing should probably be done differently, too. This is not a demonstration of the FreedomBox. It's a demonstration of vmdebootstrap. The following command builds the image. Passwords are fixed, so you'll want to not run the image on a public network.
sudo vmdebootstrap \
--log fboxlite.log \
--log-level debug \
--image fboxlite.img \
--hostname fboxlite \
--size 1G \
--verbose \
--enable-dhcp \
--package ssh \
--package apache2 \
--mirror http://mirror.lan/debian/ \
--customize=./fboxlite-customize \
--root-password=password1
You'll need the following customization script as well:
#!/usr/bin/python
import crypt
import os
import subprocess
import sys
def runcmd(argv, stdin='', ignore_fail=False, **kwargs):
    p = subprocess.Popen(argv, stdin=subprocess.PIPE, 
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE, 
                         **kwargs)
    out, err = p.communicate(stdin)
    if p.returncode != 0:
        msg = 'command failed: %s\n%s\n%s' % (argv, out, err)
        if not ignore_fail:
            raise Exception(msg)
    return out
print 'Customizing fboxlite'
rootdir = sys.argv[1]
# Create a fboxlite account.
runcmd(['chroot', rootdir, 'adduser', '--gecos', 'Freedombox Lite',
        '--disabled-password', 'fboxlite'])
encrypted = crypt.crypt('password1', '..')
runcmd(['chroot', rootdir, 'usermod', '-p', encrypted, 'fboxlite'])
# Create /srv/shared for holding shared files.
shared = os.path.join(rootdir, 'srv', 'shared')
os.mkdir(shared)
runcmd(['chroot', rootdir, 'chown', 'fboxlite:fboxlite', 'srv/shared'])
os.chmod(shared, 0775)
# Configure Apache to serve /srv/shared as /shared.
conf = os.path.join(rootdir, 'etc', 'apache2', 'sites-available', 'default')
text = open(conf, 'r').read()
lines = text.splitlines()
new_lines = [
    'Alias /shared "/srv/shared"',
    '<Directory "/srv/shared/">',
    'Options Indexes',
    '</Directory>',
]
lines = lines[:-1] + new_lines + lines[-1:]
text = ''.join('%s\n' % line for line in lines)
open(conf, 'w').write(text)
If you're using libvirt with KVM, you can then use the following command to deploy the disk image:
virt-install --connect qemu:///system -n fboxlite -r 512 \
--os-type linux --os-variant debiansqueeze \
--disk $(pwd)/fboxlite.img --vnc  --import
Log in via the emulated console, and run ip addr to see what the IP address of the virtual machine is (and if you can find a way to query libvirt what the address is, please tell me). Then you can use the following URLs (in, for example, Nautilus):
sftp://fboxlite@192.168.122.133/srv/shared/
http://192.168.122.133/shared/
Replace the correct IP address in the above URLs and off you go.

13 February 2011

Evgeni Golov: Mustek PoweMust 1000 USB on Debian Squeeze

Some (long) time ago, I wrote an article how to setup a Mustek PowerMust 1000 USB on Debian Sarge. Since then Etch, Lenny and now Squeeze were released and the machine the UPS was attached to was replaced.Yesterday I have upgraded this machine from Lenny to Squeeze and of course nut has kicked me in the nuts, telling me it can t connect to the UPS.When I replaced the old machine, I had to connect the UPS via USB instead of serial, as the new machine has only one serial port and that one is needed for the serial console to my Sun Netra T1. On Lenny, I was using the megatec_usb driver which seems borked on Squeeze and is superseeded by the blazer_usb one. So here is my nut setup on Squeeze:nut.conf:
MODE=standalone
UPSD_OPTIONS=""
UPSMON_OPTIONS=""
ups.conf:
[powermust]
    driver = blazer_usb
    port = schrank
    vendorid = 0665
    productid = 5161
    desc = "Mustek PowerMust 1000"
Yes, port has to be set, but can be any random string.upsd.conf:
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
REJECT all
upsmon.conf:
RUN_AS_USER nut
MONITOR powermust@localhost 1 nut nut master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
upssched.conf:
CMDSCRIPT /upssched-cmd
I hope this helps someone ;)

29 November 2010

Adnan Hodzic: DebConf11 final and official dates

If you thought you saw this post already, you re right, since this is our second time announcing official DebConf11 dates. First time announced dates can be found on: DebConf11 official dates deprecated (Nov 29th update)
Official and Final DebConf11 dates in Banja Luka, Bosnia and Herzegovina are:
DebCamp: 17 23 July 2011
DebConf: 24 30 July 2011

On behalf of whole DebConf11 team I would like to apologize to everybody who already organized and booked their vacation after initial announcement, reasons why these dates were altered can be found on debconf-team discussion on Let s decide DebConf11 final dates .
These dates will be announced on Debian website as official announcment as well.
See you in Bosnia? Smile

http://wiki.debconf.org/wiki/DebConf11/BanjaLuka

17 September 2010

Russell Coker: Preferring Low Quality and Microsoft Software

Is Low Quality in Italian Academia related to the choice of Low Quality Software? Diego Gambetta and Gloria Origgi wrote an interesting paper titled L-worlds: The curious preference for low quality and its norms [1]. The paper describes how in Italian universities (and large portions of Italian life) there are covert agreements that both parties in a transaction (the employee and the employer or the buyer and the seller) will deliver less than agreed while pretending that they are offering the agreed exchange. People who offer high quality in exchanges are discriminated against because they make people who offer low quality in exchange feel guilty. Nathan suggests that this is the explanation for people choosing to pay for inferior software from Microsoft instead of getting superior software for free [2]. Now it does seem quite plausible that someone who is offering low quality goods in the manner of Italian academia would refuse to consider software from any company other than Microsoft, after all the easiest way of selecting software is to phone a MS representative and be told exactly what to buy. But I don t think that this explains even a significant fraction of the people who refuse free software. There is no direct analogy between bilateral agreements to produce low quality and the choice of MS Software because MS Software is quite expensive (they demand what would be considered a high quality trade in the jargon of the paper). If someone was to buy one of the cheaper laptops in Australia (around $650 new) and upgrade to the full version of Windows 7 along with purchasing the home version of MS Office then the cost of software would be almost as much as the cost of hardware. If they wanted one other MS product then the cost of MS software would probably be greater than the cost of hardware. Hardware costs are steadily falling and MS prices are only increasing, for people who use MS software we should expect that soon the MS tax will be the majority of the costs of running a typical PC. Good Reasons for Choosing MS One thing we have to consider is that there are people who have good reasons for using MS software. One example is the companies that depend on proprietary applications which are central to their business. When the entire company s data is stored in an undocumented proprietary database it s really not easy to change to a different application even when everyone in the company knows the software to be of amazingly low quality. If the vendor of the proprietary application in question decides to only support MS Windows then it s customers (victims?) have no choice about which OS to use. One interesting thing to note about such companies that are locked in to proprietary software is that the amount that they spend per year on license and support fees is usually greater than the cost of hiring one good programmer. If a few such companies formed a consortium to develop free software to manage their business where each company paid the salary of one programmer then after a couple of years of development they could move to the free software and reduce their operating expenses. Another category of users who have a good reason to choose MS is the people who play games seriously. If you want to play games then MS Windows does offer some real advantages. The price of games will usually be a fraction of the hardware cost (the serious gamers spend a lot more on hardware than most people) and MS Windows is apparently the best PC OS for commercial games. Personally I ve found that there are more than enough free games on Linux to waste my time, Warzone 2100 [3] is one that I currently play, and I ve tried Battle for Wesnoth [4] in the past and found it too time consuming and addictive. How a Preference for Low Quality could lead to Microsoft I think that everyone who has any significant experience in the computer industry has encountered companies that have large areas of low quality. This generally tends to be in large corporations as small companies can t afford the waste. In some large corporations Linux on the desktop is never considered, even when people are hired as Linux sysadmins and there are obvious productivity benefits to having the same OS on the desktop as on the servers (even if two desktop PCs are required so that proprietary software can be run on MS-Windows). Major wrote a good satire of the corporate IT non-working culture with a comparison to medical work [5], it illustrates the principle of a coalition to ensure low quality. He later documented how he was sacked by the low quality coalition at a company that uses a lot of Microsoft software [6]. So it does seem that when customers don t care at all about the quality of the result it does help drive some sales for Microsoft. But that doesn t explain the market share that they have. It takes a lot of work to get Market Share without Quality Microsoft has spared no effort in gaining market share. Every possible effort including buying out small competitors, aggressively FUDing competition, using all manner of legal attacks (including the threat of patent suits), and deliberately breaking standards has been used. I think it s reasonable to assume that the MS senior management are not entirely stupid, they do so many things that are unethical and possibly illegal because they know that they need to do so to maintain their market share. The result is that the market capitalisation of MS is almost as high as that of Apple and Apple makes vastly superior products. Given the amount of effort that MS uses to keep market share it seems apparent that they aren t just relying on customers not caring about quality. Should users have to Understand Computers? My observation is that most users don t want to know much about how their computers work. The desire to understand computers seems to be about as common as the desire to understand cars, people just want to buy one that looks good and have it work. The difference is that cars are very compatible while computers aren t. Cars have the same controls in the same places and large parts of the design are specified by law so that they can t differ between models. Proprietary software is usually intentionally incompatible with other software (both open and proprietary) to try and gain a competitive advantage. Hardware is often incompatible due to the rapid developments in technology and the requirements for new interfaces to take advantage of new features. In concept it seems reasonable for someone who is about to spend $30,000 on a car and $1000 on a computer (for hardware and software) to spend 30 times longer considering which brand of car to buy. One could argue that more than 30 times as much consideration should be given to the car as most people can t afford to discard a car that they don t like. As people spend a few minutes considering which brand of car to buy they can be excused for spending a few seconds considering which type of computer to buy. But once a choice has been made about which software to use it s very difficult to change to something else, while in comparison it s easy to drive a car that was manufactured by a different company. So a poorly informed choice made at an early stage can have costly long-term affects when buying software. If we had mandated open standards for file formats and data interchange then users would be able to make choices that don t result in their data being locked in to some proprietary format. Such standards could be set through government tender processes, if every government agency was to only buy software that complies with open standards then the proprietary software vendors would scramble to make their products less incompatible. The result would be that bad choices in purchasing software could become learning experiences that result in better purchases in future instead of being a lock on users that forces them to keep using the same software that doesn t satisfy their needs. Conclusion I think that the best thing about the paper by Diego Gambetta and Gloria Origgi is that it highlights the issue of low quality. No-one wants to be considered a loser, so maybe this can encourage people to strive for high quality (or at least try to make their work suck a little less). Regardless of the conclusion they eventually reach, it s probably good for people to occasionally wonder do I suck? .

24 April 2010

Francois Marier: Monitoring a Belkin 600VA UPS with NUT on Debian/Ubuntu

I recently bought a Belkin 600VA UPS (model F6S600auUSB) and here's what I had to do to setup the monitoring and automatic shutdown on Ubuntu 9.10 (karmic). (This procedure should work on recent versions of Debian as well.)

This UPS comes with a proprietary monitoring tool (written in Java) and you can find instructions to get this working on the Ubuntu forums, but I was looking for a free solution that would integrate well with the rest of the system. So after reading this blog post I decided to go with the Network UPS Tools project:

$ apt-get install nut

Once the nut package is installed, I edited /etc/nut/nut.conf to set:

MODE=standalone

and created the following files:

$ vim /nut/ups.conf

[belkinusb]
driver = megatec_usb
port = auto
desc = "Belkin UPS, USB interface"

$ vim /etc/nut/upsd.conf

# MAXAGE 15
# LISTEN 127.0.0.1 3493
# MAXCONN 1024

$ vim /etc/nut/upsd.users

[local_mon]
password = MYPASSWORD
upsmon master

$ vim /etc/nut/upsmon.conf

MONITOR belkinusb@localhost 1 local_mon MYPASSWORD master
POWERDOWNFLAG /etc/killpower
SHUTDOWNCMD "/sbin/shutdown -h +0"

Then all that was left to do was to restart nut:

$ /etc/init.d/nut restart

and check syslog for any errors:

$ tail /var/log/syslog

While nut is running, it will monitor the UPS and report any power problems to syslog. Once the UPS is running on battery, it will make sure the computer is safely shut down before power runs out.

Hopefully future versions of GNOME Power Manager will be able to integrate with nut directly and display battery information through its notification icon.

9 April 2010

Ingo Juergensmann: Syncing N97

We now have year 2010 but sometimes it still feels like living in the Stone Age of Computing. There's a smartphone, let's call it N97, with Symbian on it. Then there are a bunch of client computers such as a Debian workstation/homeserver running Sid, a Laptop running OS X with iCal and a Windows XP machine at work. Every machine itself (well, with the exception of the XP machine) is a nice piece of hard- and software offering a bunch of possibilities: you can manage your calendars, contacts and tasks.

The difficulty arise when you want to sync those calendars, contacts and tasks between all of the different machines.

There are several ways to address this task:

  1. WebDAV:
    Setting up a WebDAV is no rocket science and you can easily sync your calendars easily with Sunbird or Thunderbird/Lightning for example. But that leaves the N97 ouf of syncing. The N97 can be synced with iSync on OS X, but iCal is not able to work on a single calendar. You can either export a calendar to a remote WebDAV or subscribe it. iCal ignores changes done in other clients and will overwrite those.


  2. CalDAV 1:
    CalDAV (calendarserver) does require some more configuration before you can use it properly, but when done, it should be capable of syncing calendars, resources, tasks and such. Using CalDAV should work aorund the limitations of WebDAV as mentioned above. The calendars can be synced to CalDAV from iCal by creating a remote account and you can sync with iSync via Bluetooth. But you will need a local calendar in iCal, because you can't use iSync to sync your smartphone to your CalDAV remote calendar in iCal.

    iSync unable to use CalDAV for syncing


    Additionally there are problems when you delete an event from your CalDAV calendar on your smartphone. iSync will report an error like this:

    Freitag, 9. April 2010 21:45
    [Nokia N97]
    Changes of Events in writeprotected calendar on this phone are not permitted. These changes were ignored: test, 04/09/2010 23:00


    Deleting events in your local iCal calendar, however, is working well. In the end this result is not encouraging as I need the CalDAV calendars being in sync.
    Syncing with Sunbird on OS X doesn't work either. Maybe it would with DAViCal as server frontend?


  3. CalDAV 2:
    Because syncing via iSync doesn't work as expected it would be a decent solution if the N97 could sync directly to CalDAV. Unfortunately it can't, although there seems some progress with Symbian there. If that is already integrated into v21.0.102 of N97 firmware, it would nice if someone could point me to how configure the N97 properly.


  4. SyncML:
    Maybe another option would be to use some sort of SyncML server in order to sync calendars and stuff between those machines, but I don't know how OS X will work with that approach. Again, hints are welcome!


Syncing calendars and other stuff really seems to be painful. Using a third party webservice such as .Mac or Google Calendar is no option at all. I don't want to give private data out of my hands and control. So, a self hosted service is needed.
Dear lazyweb, is there a solution available for my problem? I hope so...

16 September 2009

Ingo Juergensmann: Problems with xrandr/krandr

For some time now I'm using a dual monitor setup with my Radeon 9200 SE (RV280). Basically this works quite well, except that I need to enter these commands manually:

CODE:
xrandr --output VGA-0 --mode 1280x1024
xrandr --output DVI-0 --auto
xrandr --output DVI-0 --primary
xrandr --output DVI-0 --right-of VGA-0


Without these settings krandr is unable as well to detect both monitors properly. And it's not remembering the settings when I close/save the session by logging out. I tried to add the above code lines in ~/xinitrc as well as in /etc/X11/xinit/xinitrc, but they are not executed as after a restart of X I end up with the wrong monitor being the primary instead of the DVI display.

My xorg.conf is this:

CODE:
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen2" LeftOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

#Section "ServerFlags"
# Option "Xinerama" "off"
#EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "dbe"
Load "dri"
Load "extmod"
Load "glx"
Load "record"
Load "dri2"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
#DisplaySize 430 270 # mm
Identifier "DVI-0"
VendorName "SAM"
ModelName "SyncMaster"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option "DPMS"
Option "Enable" "true"
Option "PreferredMode" "1680x1050@60"
EndSection

Section "Monitor"
#DisplaySize 430 270 # mm
Identifier "VGA-0"
VendorName "HP"
ModelName "L1925"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option "DPMS"
#Option "Enable" "true"
Option "LeftOf" "DVI-0"
#Option "PreferredMode" "1280x1024@60"
EndSection

Section "Device"

Identifier "Card0"
Driver "radeon"
VendorName "ATI Technologies Inc"
BoardName "RV280 [Radeon 9200 SE]"
BusID "PCI:1:0:0"
Option "Monitor-DVI" "DVI-0"
#Option "Monitor-VGA" "VGA-0"
Screen 0
EndSection

Section "Device"
Identifier "Card1"
Driver "radeon"
VendorName "ATI Technologies Inc"
BoardName "RV280 [Radeon 9200 SE]"
BusID "PCI:1:0:1"
Screen 1
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "DVI-0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
Virtual 2960 1050
Option "InitPrimary" "true"
EndSection

Section "Screen"
Identifier "Screen2"
Device "Card1"
Monitor "VGA-0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
Virtual 2960 1050
EndSection


So, dear lazyweb, what's wrong with this setup and how can I fix it?

4 December 2008

Michael Banck: 4 Dec 2008

Opensync updates Some time ago, Opensync-0.38 got released, and it is now available in experimental. The evolution-data-server and the Opie plugins are now available again, as well as the new tomboy (in NEW) and a rewritten google-calendar/contacts plugin. The google plugin requires the new libgcal, which I have just uploaded to NEW. Unfortunately, kitchensync is still not ported to latest Opensync-0.3x (and got dropped for KDE4.2), so one still needs to use the command-line msynctool program. Also not ported are the (KDE3) kdepim and the currently under development Akonadi plugin. Other important plugins missing for 0.38 are the Windows Mobile, Blackberry, Palm and IRMC plugins. I tried to suggest making 0.38.x point releases including more ported plugins, but it seems development is turning towards 0.39 already, and yet some more API changes were done, this time mostly removing unnecessary interfaces, which should be a good thing in the long term. Some other good news is that there are now weekly IRC meetings of the Opensync developers, so there should be steadier progress towards Opensync-0.40 from now on. Unfortunately, I was mostly absent during all of the three meetings so far. Along with Opensync-0.38, libsyncml saw a new major release 0.5.0 which should fix lots of bugs and provide better support for mobiles. However, lots of problems with syncml were due to bugs in the wbxml2 library. Michael Bell has hopefully found the most critical ones and I have uploaded a new wbxml2-0.9.2 to unstable today which I hope will get into lenny soon. The main problem with wbxml2 over the last year was a unresponsive/MIA upstream; however, recently wbxml2 maintainership got tranferred to the opensync project and moved to its Trac. Michael Bell has been fixing most of the outstanding issues and is currently preparing a 0.10.0 release, so this project should be back on track now.

18 November 2008

Adrian von Bidder: SyncML (new toy)

Q: is a mobile phone (nice hardware, shitty firmware, btw) waterproof? A: I now got this new toy (Sony Ericsson S500i) as aresult. And because I don't really like losing contacts again (I never managed to connect to the old phone from Linux and was too lazy to use the Windows software), I have now fired up kitchensync with the OBEX SyncML client from the OpenSync project. And was very surprised that after only very little fiddling with the configuration I could indeed copy the contacts from the phone to KDE's addressbook. There seems to be a — not so usual anymore in this decade — utf8 problem somewhere (it looks as if the encoding from the phone is converted to utf8 twice, or it is latin1 to utf8 encoded but was already utf8 on the phone), and synchronisation is only one way so far (from the phone to KDE-PIM), with changes on the KDE side being overwritten. No idea which component those bugs are in, and documentation I've found is not very verbose. So, to start with: I've gotten this nice dump with hcidump. Now, how do I extract the actual data streams from that dump? I know I have to use wbxml2xml on the data, but first I need to unwrap the network data, and I haven't found that (probably read past it in the manpage of hcidump because I'm a bit tired.) Of course, if anybody out there has solved my issues I'd be just as happy with information on how that was done instead. In the mean time, I at least have reasonable back up of my phone's contact database again.

23 October 2008

Adam Rosi-Kessel: Republic National Committee Helps Obama Fundraising

The only plausible result from this RNC mailing, I think, is increased fundraising for Obama over the next few days:
Terrorists Dont Care Who They Hurt

"Terrorists Don't Care Who They Hurt"

For the nearsighted, the front of the mailing says “Terrorists Don’t Care Who They Hurt” and inside: “Why Should We Care What They Have to Say? … Barack Obama. Not Who You Think He Is.” I would be surprised if the Obama campaign doesn’t get a measurable bump in donations for every mailing like this. What I really wonder is how intelligent Republican party members tolerate this sort of thing. Aside from Colin Powell, are other high-IQ Republicans voting against their party because of these tactics? Or do they just believe any means justify the ends? My pet theory as to why these attacks are useless (at best) to the GOP is that they don’t resonate with anything the voters are seeing. The GOP implies Obama is a muslim terrorist who is inexperienced and risky and also an extreme liberal/socialist left-winger (I haven’t heard “communist” yet from the mainstream), while what the electorate sees in the debates, ads, and campaign appearances is an uncannily steady, balanced, articulate individual who comes across as a moderate on most issues (note Obama’s theme of returning to Reagan-era taxation levels!) At least with the “flip-flopper” attacks (and maybe even the Swift-Boat attacks) on John Kerry, there was something people could see that somewhat corresponded with the attacks, even if the underlying facts didn’t actually pan out. Here, the chasm between the nature of the attacks and the visible target is so great, they could only help energize those who are already hard-core partisans. The lesson here is that if you want to launch misleading, baseless attacks against your opponent, at least find some kernel of truth to base them on. On a similar note, I agree with Aaron Swartz that ACORN deserves our financial support. Finally, I predict a bunch of astroturf comments to this blog entry. I won’t bother to respond if the comments fail to say anything intelligible. Technorati Tags: , , , , ,

Adam Rosi-Kessel: Republic National Committee Helps Obama Fundraising

The only plausible result from this RNC mailing, I think, is increased fundraising for Obama over the next few days:
Terrorists Dont Care Who They Hurt

"Terrorists Don't Care Who They Hurt"

For the nearsighted, the front of the mailing says “Terrorists Don’t Care Who They Hurt” and inside: “Why Should We Care What They Have to Say? … Barack Obama. Not Who You Think He Is.” I would be surprised if the Obama campaign doesn’t get a measurable bump in donations for every mailing like this. What I really wonder is how intelligent Republican party members tolerate this sort of thing. Aside from Colin Powell, are other high-IQ Republicans voting against their party because of these tactics? Or do they just believe any means justify the ends? My pet theory as to why these attacks are useless (at best) to the GOP is that they don’t resonate with anything the voters are seeing. The GOP implies Obama is a muslim terrorist who is inexperienced and risky and also an extreme liberal/socialist left-winger (I haven’t heard “communist” yet from the mainstream), while what the electorate sees in the debates, ads, and campaign appearances is an uncannily steady, balanced, articulate individual who comes across as a moderate on most issues (note Obama’s theme of returning to Reagan-era taxation levels!) At least with the “flip-flopper” attacks (and maybe even the Swift-Boat attacks) on John Kerry, there was something people could see that somewhat corresponded with the attacks, even if the underlying facts didn’t actually pan out. Here, the chasm between the nature of the attacks and the visible target is so great, they could only help energize those who are already hard-core partisans. The lesson here is that if you want to launch misleading, baseless attacks against your opponent, at least find some kernel of truth to base them on. On a similar note, I agree with Aaron Swartz that ACORN deserves our financial support. Finally, I predict a bunch of astroturf comments to this blog entry. I won’t bother to respond if the comments fail to say anything intelligible. Technorati Tags: , , , , ,

8 October 2008

Wouter Verhelst: Why I don't want an iSomething, part II

Bjorn mentions that he doesn't want the nokia internet tablet, because it doesn't have a phone and he doesn't want to carry two devices with him. portable media player Bottom left, my portable media player. 4G solid-state storage, plays movies (the display shows a scene from Star Trek: Deep Space Nine that I converted from DVD), audio, FM radio, and after a firmware update can do games and some random applications. Does bluetooth. Does not do phone calls. Upper right, my cell phone. A simple Nokia 6021. Does bluetooth, makes phone calls, and (as the display somewhat shows) can do calendaring, too. With SyncML, I can synchronize it with my laptop. Together, they perform anything I'd possibly want from a smartphone (and don't anyone tell me 'SSH', because doing ssh on any screen smaller than, 7" and without decent keyboard is laughable). Together, they're smaller and weigh less than a smartphone. Together, they're less expensive than a smartphone ( 125 for the phone, 85 for the portable media player). Why does anyone buy a smartphone?

21 September 2008

Wouter Verhelst: SSL "telnet"

A common way to debug a network server is to use 'telnet' or 'nc' to connect to the server and issue some commands in the protocol to verify whether everything is working correctly. That obviously only works for ASCII protocols (as opposed to binary protocols), and it obviously also only works if you're not using any encryption. But that doesn't mean you can't test an encrypted protocol in a similar way, thanks to openssl's s_client:
wouter@country:~$ openssl s_client -host samba.grep.be -port 443
CONNECTED(00000003)
depth=0 /C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
verify return:1
---
Certificate chain
 0 s:/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
   i:/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDXDCCAsWgAwIBAgIJAITRhiXp+37JMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV
BAYTAkJFMRAwDgYDVQQIEwdBbnR3ZXJwMREwDwYDVQQHEwhNZWNoZWxlbjEUMBIG
A1UEChMLTml4U3lzIEJWQkExFDASBgNVBAMTC3N2bi5ncmVwLmJlMR0wGwYJKoZI
hvcNAQkBFg53b3V0ZXJAZ3JlcC5iZTAeFw0wNTA1MjEwOTMwMDFaFw0xNTA1MTkw
OTMwMDFaMH0xCzAJBgNVBAYTAkJFMRAwDgYDVQQIEwdBbnR3ZXJwMREwDwYDVQQH
EwhNZWNoZWxlbjEUMBIGA1UEChMLTml4U3lzIEJWQkExFDASBgNVBAMTC3N2bi5n
cmVwLmJlMR0wGwYJKoZIhvcNAQkBFg53b3V0ZXJAZ3JlcC5iZTCBnzANBgkqhkiG
9w0BAQEFAAOBjQAwgYkCgYEAsGTECq0VXyw09Zcg/OBijP1LALMh9InyU0Ebe2HH
NEQ605mfyjAENG8rKxrjOQyZzD25K5Oh56/F+clMNtKAfs6OuA2NygD1/y4w7Gcq
1kXhsM1MOIOBdtXAFi9s9i5ZATAgmDRIzuKZ6c2YJxJfyVbU+Pthr6L1SFftEdfb
L7MCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUtUK7aapBDaCoSFRWTf1wRauCmdowgbAG
A1UdIwSBqDCBpYAUtUK7aapBDaCoSFRWTf1wRauCmdqhgYGkfzB9MQswCQYDVQQG
EwJCRTEQMA4GA1UECBMHQW50d2VycDERMA8GA1UEBxMITWVjaGVsZW4xFDASBgNV
BAoTC05peFN5cyBCVkJBMRQwEgYDVQQDEwtzdm4uZ3JlcC5iZTEdMBsGCSqGSIb3
DQEJARYOd291dGVyQGdyZXAuYmWCCQCE0YYl6ft+yTAMBgNVHRMEBTADAQH/MA0G
CSqGSIb3DQEBBQUAA4GBADGkLc+CWWbfpBpY2+Pmknsz01CK8P5qCX3XBt4OtZLZ
NYKdrqleYq7r7H8PHJbTTiGOv9L56B84QPGwAzGxw/GzblrqR67iIo8e5reGbvXl
s1TFqKyvoXy9LJoGecMwjznAEulw9cYcFz+VuV5xnYPyJMLWk4Bo9WCVKGuAqVdw
-----END CERTIFICATE-----
subject=/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
issuer=/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=svn.grep.be/emailAddress=wouter@grep.be
---
No client certificate CA names sent
---
SSL handshake has read 1428 bytes and written 316 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: 65E69139622D06B9D284AEDFBFC1969FE14E826FAD01FB45E51F1020B4CEA42C
    Session-ID-ctx: 
    Master-Key: 606553D558AF15491FEF6FD1A523E16D2E40A8A005A358DF9A756A21FC05DFAF2C9985ABE109DCD29DD5D77BE6BC5C4F
    Key-Arg   : None
    Start Time: 1222001082
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
HEAD / HTTP/1.1
Host: svn.grep.be
User-Agent: openssl s_client
Connection: close
HTTP/1.1 404 Not Found
Date: Sun, 21 Sep 2008 12:44:55 GMT
Server: Apache/2.2.3 (Debian) mod_auth_kerb/5.3 DAV/2 SVN/1.4.2 PHP/5.2.0-8+etch11 mod_ssl/2.2.3 OpenSSL/0.9.8c
Connection: close
Content-Type: text/html; charset=iso-8859-1
closed
wouter@country:~$ 
As you can see, we connect to an HTTPS server, get to see what the server's certificate looks like, issue some commands, and the server responds properly. It also works for (some) protocols who work in a STARTTLS kind of way:
wouter@country:~$ openssl s_client -host samba.grep.be -port 587 -starttls smtp
CONNECTED(00000003)
depth=0 /C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
verify return:1
---
Certificate chain
 0 s:/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
   i:/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDBDCCAm2gAwIBAgIJAK53w+1YhWocMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
BAYTAkJFMRAwDgYDVQQIEwdBbnR3ZXJwMREwDwYDVQQHEwhNZWNoZWxlbjEUMBIG
A1UEChMLTml4U3lzIEJWQkExFjAUBgNVBAMTDXNhbWJhLmdyZXAuYmUwHhcNMDgw
OTIwMTYyMjI3WhcNMDkwOTIwMTYyMjI3WjBgMQswCQYDVQQGEwJCRTEQMA4GA1UE
CBMHQW50d2VycDERMA8GA1UEBxMITWVjaGVsZW4xFDASBgNVBAoTC05peFN5cyBC
VkJBMRYwFAYDVQQDEw1zYW1iYS5ncmVwLmJlMIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQCee+Ibci3atTgoJqUU7cK13oD/E1IV2lKcvdviJBtr4rd1aRWfxcvD
PS00jRXGJ9AAM+EO2iuZv0Z5NFQkcF3Yia0yj6hvjQvlev1OWxaWuvWhRRLV/013
JL8cIrKYrlHqgHow60cgUt7kfSxq9kjkMTWLsGdqlE+Q7eelMN94tQIDAQABo4HF
MIHCMB0GA1UdDgQWBBT9N54b/zoiUNl2GnWYbDf6YeixgTCBkgYDVR0jBIGKMIGH
gBT9N54b/zoiUNl2GnWYbDf6YeixgaFkpGIwYDELMAkGA1UEBhMCQkUxEDAOBgNV
BAgTB0FudHdlcnAxETAPBgNVBAcTCE1lY2hlbGVuMRQwEgYDVQQKEwtOaXhTeXMg
QlZCQTEWMBQGA1UEAxMNc2FtYmEuZ3JlcC5iZYIJAK53w+1YhWocMAwGA1UdEwQF
MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAAnMdbAgLRJ3xWOBlqNjLDzGWAEzOJUHo
5R9ljMFPwt1WdjRy7L96ETdc0AquQsW31AJsDJDf+Ls4zka+++DrVWk4kCOC0FOO
40ar0WUfdOtuusdIFLDfHJgbzp0mBu125VBZ651Db99IX+0BuJLdtb8fz2LOOe8b
eN7obSZTguM=
-----END CERTIFICATE-----
subject=/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
issuer=/C=BE/ST=Antwerp/L=Mechelen/O=NixSys BVBA/CN=samba.grep.be
---
No client certificate CA names sent
---
SSL handshake has read 1707 bytes and written 351 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: 6D28368494A3879054143C7C6B926C9BDCDBA20F1E099BF4BA7E76FCF357FD55
    Session-ID-ctx: 
    Master-Key: B246EA50357EAA6C335B50B67AE8CE41635EBCA6EFF7EFCE082225C4EFF5CFBB2E50C07D8320E0EFCBFABDCDF8A9A851
    Key-Arg   : None
    Start Time: 1222000892
    Timeout   : 300 (sec)
    Verify return code: 18 (self signed certificate)
---
250 HELP
quit
221 samba.grep.be closing connection
closed
wouter@country:~$ 
OpenSSL here connects to the server, issues a proper EHLO command, does STARTTLS, and then gives me the same data as it did for the HTTPS connection. Isn't that nice.

11 August 2008

Michael Banck: 11 Aug 2008

OpenSync update To give some update on the state of OpenSync in Debian, I have uploaded libsycml-0.4.7 to experimental a couple of days ago. This is significant in sofar as a lot of development and bug-fixing (mostly by Michael Bell) happened for this release, as well as some committment to maintaining an API and at least responsively versioning the library. In order to use libsyncml-0.4.7 with OpenSync, a newer libopensync than 0.36 is needed; however, current OpenSync trunk has seen a lot of changes in plugin handling and plugins need to get ported to the new API. So I uploaded the last known-working revision of OpenSync along with corresponing revisions of the file-sync and syncml plugins, the vformat module and a rebuild of msynctool to experimental for now. I did not have the time or energy to migrate/upload the other plugins yet, and as it seems that OpenSync-0.37 will only ship with ported file-sync and syncml plugins, it might not make much sense. I also took over maintainership of the related wbxml2 package, and upload a patch by Michael Bell which seem to fix a lot issues people are having with SyncML. The good news is that it seems all of the new features for a 0.40 stable OpenSync release have been finished according to the roadmap , most notably a common plugin configuration system and the machinery for a migration path from 0.22 to 0.40 configurations (plugins still need to support/implement that I believe), so no more big API changes are expected and the focus will be on bugfixing and plugin discovery from now on. This means developers will be able to start porting their plugins to the 0.40 API once 0.37 is out and front-end authors can start to take a look at the architectural changes which were made to facilitate their jobs. My hope is that conduit will be able to leverage the OpenSync technology and introduce a solid GUI for this (as kitchensync does for KDE), making syncronization finally work on the desktops. From the Debian packaging point of view, I have been mostly on my own now for the last couple of months. However, I recently registered an Alioth project in order to maintain the packages in a subversion repository (I have not yet decided whether it is worth importing the 0.22 packages targetted at lenny), and people who are interested in helping should contact me.

22 July 2008

Michal &#268;iha&#345;: Phone synchronisation, finally

One of long standing things on my todo list was to make synchronisation work from my cell phone (Sony-Ericsson K750i) to some PIM application on Linux side (as a GNOME user Evolution is the natural choice). I tried it several times but it never actually worked. Today I gave it yet another try and I finally succeeded on first attempt :-). As a first step I just wanted to make a backup of all things. Gammu can do it quite well and it's the tool I trust for this purpose:
gammu backup /tmp/phonebook.vcf
gammu backup /tmp/calendar.vcs
Now it's time to play with OpenSync. We will use setup guide and SyncML guide as a starting point. As I had in past problems with both sides - both phone and Evolution failed with some random errors, I wanted to go step by step. So I started with setting up phone to files synchronisation:
msynctool --addgroup file2phone
msynctool --addmember file2phone file-sync
msynctool --addmember file2phone syncml-obex-client
Now we need to configure file storage, just tell it where it should store the data:
msynctool --configure file2phone 1
And change path in your editor to something like:
<?xml version="1.0"?>
<config>
  <!-- directory path for file-sync -->
  <path>/home/foo/phone-backup/</path>
  <!-- should care of subdirectories (TRUE or FALSE) -->
  <recursive>FALSE</recursive>
</config>
Now the more tricky part comes, we need to set up phone end:
msynctool --configure file2phone 2
Fortunately we can use example from the SyncML guide and just fill in Bluetooth address (you can get it using hcitool scan) and channel (sdptool browse 00:b0:0b:fa:ce:00):
<?xml version="1.0"?>
<config>
  <bluetooth_address>00:b0:0b:fa:ce:00</bluetooth_address>
  <bluetooth_channel>7</bluetooth_channel>
  <identifier>Sony Ericss</identifier>
  <version>1</version>
  <wbxml>1</wbxml>
  <username></username>
  <password></password>
  <type>2</type>
  <usestringtable>0</usestringtable>
  <onlyreplace>0</onlyreplace>
  <onlyLocaltime>0</onlyLocaltime>
  <recvLimit>0</recvLimit>
  <maxObjSize>0</maxObjSize>
  <contact_db>Contacts</contact_db>
  <calendar_db>Agenda</calendar_db>
  <note_db>Notes</note_db>
</config>
And now we should be able to synchronise whole phonebook from phone to selected directory:
msynctool --sync file2phone
Okay, this works, let's try more complicated thing - include Evolution in the chain. The steps are the same, config file for phone is the same, Evolution plugin has sane defaults you usually don't have to touch:
msynctool --addgroup phone2evo
msynctool --addmember phone2evo evo2-sync
msynctool --addmember phone2evo syncml-obex-client
msynctool --configure phone2evo 1
msynctool --configure phone2evo 2
But now comes the tricky thing - Sony-Ericsson phones usually have something broken around notes (or it is broken in OpenSync, I don't care, simply synchronisation fails without this step) and we have to avoid synchronisation of them. This can be done by changing filter file in group we've created above (usually in file ~/.opensync-0.22/group2/filter.conf):
<?xml version="1.0"?>
<filter>
  <note/>
</filter>
And finally we can start the synchronisation and it should work:
msynctool --sync phone2evo
You can also GUI multisync0.90 to do the configuration and start synchronisation, but it is not much different, you also still have to edit XML files.

1 June 2008

Axel Beckert: Debian and GPRS with the Nokia E51

A while ago I wanted to have internet over GPRS (either EDGE or UMTS) via my Nokia E51 working before I leave for the weekend. But whatever I tried, I always got an ERROR if I sent any AT command. Even ATZ and ATH resulted in errors. So started googling for all components: I found AT commands which are said to work with the Nokia E51, I found AT commands which are said to work with Swisscom GPRS and I found many sites describing how to setup a bluetooth modem. But since the even those AT commands which should work with both, Swisscom GPRS and Nokia E51 didn’t work at all, I noticed that all the Nokia E51 howtos were using the USB cable. So I tried that, too, and it worked immediately. It looks very strange to me that the set of AT commands is dependend on which way you connect to the phone. :-/ So here’s my working PPP config:
hide-password
noauth
connect "/usr/sbin/chat -e -f /etc/chatscripts/swisscom-gprs"
/dev/ttyACM0
460800
defaultroute
crtscts
user "guest"
usepeerdns
noccp
bsdcomp 0,0
lcp-echo-failure 10000
lcp-echo-interval 1000
asyncmap 0
novj
nomagic
and the chat script (/etc/chatscripts/swisscom-gprs):
TIMEOUT 5
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO ANSWER'
ABORT DELAYED
ABORT ERROR
'' \nAT
TIMEOUT 12
OK ATH
OK ATE1
OK 'AT+CGDCONT=1,"IP","gprs.swisscom.ch"'
OK ATD*99#
CONNECT ""
So I have now four levels of mobile computing available: Fixing servers while sitting on a park bench at Schanzengraben Should suffice in nearly all situations. ;-)

26 March 2008

Nico Golde: streaming from your fileserver using mpd and icecast

My mobile music player is often missing the files I want to hear right now if I'm under way because my music collection is too big to fit on it.
Long time ago I used gnump3d which seems to be unmaintained in Debian for quite some time and then I often listened to some live streams, network connections are available nearly everywhere.
But I always wanted my own live stream with music I want to hear. There are several solutions out there for this task but they all require the creation of a playlist before the streaming starts.

Fortunately mpd provides the possibility to define different output targets and also one for streaming to a shoutcast or compatible server like icecast.

So after apt-get install mpd icecast2 (on a Debian box) you have to edit /etc/mpd.conf
There is not much to do, be sure to set music_directory to the place your music is located and the configure the output part.
Add the following to your mpd.conf and adapt some values:
  1. audio_output {
  2.         type "shout"
  3.         name "foobar stream"
  4.         port "8000"
  5.         host "localhost"
  6.         format  "44100:16:2"
  7.         mount "/stream.ogg"
  8.         password "somepass"
  9.         quality "2"
  10.         user "source"
  11. }

The type defines that this output will be streamed to a shoutcast target. The name will be displayed by the client you use to play your stream. 8000 is the port icecast2 will listen on host "localhost" (in this example the icecast2 server is on the same host). format specifies the audio format of the stream, the first number is the sample rate in Hz, the second number is the number of bits per sample and the last number defines the number of channels (2 is stereo here). Those values should work for most of you. mount specifies the path under which the stream is available later from the server root, in this example http://localhost:8000/stream.ogg.
quality defines the ogg encoding "quality". You can also specify the bitrate instead of it. The user and password values are used to authenticate mpd at the source input for icecast2.

There seems to be a bug in the 0.13 release (which is also in Debian) of mpd that prevents this from working. I don't know the details about this bug but adding
  1. audio_output {
  2.         type "alsa"
  3.         name "fake out"
  4.         driver "null"
  5. }
fixes it.

Make sure to set START_MPD=true in /etc/default/mpd to enable mpd.
That's all that needs to be done for mpd.

The next step is to edit /etc/icecast2/icecast.xml.
The default configuration nearly ready to use. Configure the authentication part:
  1. <authentication>
  2.       <source-password>somepass</source-password>
  3.       <admin-user>admin</admin-user>
  4.       <admin-password>someadminpass</admin-password>
  5. </authentication>

The source password is the one we specified in the mpd configuration. This is needed to authenticate mpd with icecast. source is the default user name icecast uses here. Additionally we define an admin-user that can be used to add users to icecast later because we want to protect the stream by a username and a password.
Then set
  1. <hostname>you.somehost.org</hostname>
.
This hostname is used to generate URLs in icecast that a user receives.

Because we want a very simple authentication for the stream we need to add some options for the mount (/stream.ogg):
  1. <mount>
  2.     <mount-name>/stream.ogg</mount-name>
  3.  
  4.     <max-listeners>1</max-listeners>
  5.     <authentication type="htpasswd">
  6.             <option name="filename" value="/etc/icecast2/htpasswd"/>
  7.             <option name="allow_duplicate_users" value="0"/>
  8.     </authentication>
  9.     <on-connect>/home/icecast/bin/stream-start</on-connect>
  10.     <on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
  11. </mount>

I think the xml tags are pretty much self-explanatory. Keep in mind to set the filename to a location the icecast daemon has access to, that's why I used /etc/icecast2. Then you can add users with htpasswd or using the web interface on port 8000 and add a user there.

The last thing to do is to adjust the <alias source="/" dest="/status.xsl"/> setting. Change status.xsl to auth.xsl people need to authenticate if they connect to the web interface before seeing the stream information.

Now you can login via ssh on your home server and use your favorite mpd client to configure playlists on the fly, I use ncmpc for this. Of course the authentication is not secure, people who sniff your traffic can see your login data.
One thing to keep in mind is to restart mpd after restarting icecast otherwise mpd will hang and not continue to stream, this seems to be a bug.

After routing through your NAT, you should be able to play your stream via http://you.somehost.org:8000/stream.ogg.

16 January 2008

Michal &#268;iha&#345;: One year under my reign

One year ago, I took over Gammu maintenance. I think it time to summarize a bit what happened during that year. There were definitely good and bad releases in that time (especially strictness introduced to SMS parser in 1.13.0 took quite a lot of releases to fix various bugs), but generally I things Gammu is moving in a good way. What I would definitely call positive: There are also some bad things: Some statistics of last year (based on Ohloh):
ValueDec 2006Dec 2007Difference
Code Lines90,540101,687+12%
Comment Lines9,20415,336+67%
Comment Ratio9.2%13.0%+30%
All these changes were made in approximate 1200 commits. I hope next year will not be worse :-).

Next.

Previous.